package unit2.user;
import java.io.Serializable;
import java.util.ArrayList;

import unit2.Input;
import unit2.Test;
import unit2.UserHistory;
import unit2.creater.CreaterUsers;

public class User implements  Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6758772988000710863L;
	private String name;
	private UserHistory  userHistory;
	private ArrayList<Integer> scoreOfSesions =new ArrayList<Integer>();
	
	
	
	public User(String name ) {
		this.name= name;
	}
	
	public String getName(){
		return this.name;
	}
	
	public void setNewScore(int e){
		this.scoreOfSesions.add(e);
	}
	
	public void showScoreOfSesions(){
		if(this.scoreOfSesions.size()!=0){
			for(int e:this.scoreOfSesions){
				System.out.println(e);
			}
		}
		else System.out.println("No sesions");
	}
	
	public void setName(){
		Input name=new Input();
		this.name= name.getLine();
		
	}
	
	public boolean equals(String name){
		if(this.name.equals(name))
			return true;
		else return false;
	}
	
	public UserHistory getUserHistory(){
		return this.userHistory;
	}
	
	public void saveHistory(UserHistory history ){
		this.userHistory=history;
	}
	
	public  User(){
		this.userHistory= null;
	}
	
	public String action(){
		
		Input action =new Input();
		
		switch (action.getLine()) {
		case "n":  return "n";
		case "p":  return "p";
		case "s":  return "s";
		case "score": return "score";
		case "e":  return "e";
		default:  return "default";

		}
	}
}

